/*
 * StyleElement.cpp
 *
 *  Created on: 2010-6-7
 *      Author: Guobc
 */

#include "StyleElement.h"
#include "TextNode.h"

using namespace HA;

string StyleElement::mIds[] = {"STYLE", ""};
string StyleElement::mEnds[] = {"STYLE", "HEAD", "HTML", ""};

StyleElement::StyleElement() :
	HA::CommonElement() {

}

string StyleElement::getSyleCode(){
	ASTNodeList children = getChildren();
	ASTNode* node;
	TextNode* textNode;
	int size = children.size();
	for(int i = 0; i < size; i++){
		node = children.item(i);
		textNode = dynamic_cast<TextNode*> (node);
		if(textNode != NULL){
			return textNode->getText();
		}
	}

	return "";
}
